#pragma once
#include<assert.h>
#include<iostream>
using namespace std;

class Date
{
public:
	int GetMonthDay(int year, int month)
	{
		assert(month > 0 && month < 13);

		static int monthDayArray[13] = { -1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

		if (month == 2 && (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
			return 29;
		else
			return monthDayArray[month];
	}

	void Print();

	Date(int year = 1, int month = 1, int day = 1);
	Date& operator+=(int day);
	Date operator+(int day);
	Date& operator-=(int day);

	// -
	Date operator-(int day);

	// -  
	int operator-(const Date& d);

	bool operator==(const Date& d);
	bool operator<(const Date& d);
	bool operator>(const Date& d);
	//...

	// ++d1;
	Date operator++();
	// d1++;
	Date operator++();
private:
	int _year;
	int _month;
	int _day;
};